package com.hp.controller.api;

import com.hp.utils.WeatherUtil;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/weather")
public class ApiWeatherController {
    @CrossOrigin
    @GetMapping("/getWeather")
    public Map GetWeatherInform(@RequestParam(required=false) String name) {
        Map map = new HashMap();
        map.put("v", WeatherUtil.GetWeatherInform(name));
        return map;
    }
}
